import request from '@/utils/request'

// 获取所有分类
export const getAllCate = params => {
  return request({
    method: 'GET',
    url: '/categories/all'
  })
}

// 添加分类
export const addCate = data => {
  return request({
    method: 'POST',
    url: '/categories/add',
    data
  })
}

// 传入分类级别进行搜索
export const getCateByType = type => {
  return request({
    method: 'GET',
    url: `/categories/type/${type}`
  })
}

// 编辑分类
export const editCate = data => {
  return request({
    method: 'PUT',
    url: '/categories/update',
    data
  })
}

// 删除分类
export const delCate = id => {
  return request({
    method: 'DELETE',
    url: `/categories/delete/${id}`
  })
}

// 按照分类id查询图书
